layui.use(['upload'], function () {
    var upload = layui.upload;//得到 upload 对象
    //创建一个上传组件
    upload.render({
        elem: '#uploadVideo'
        , url: '/sp/upload'
        , accept: 'video'//视频
        ,size: 1024*10000 //限定大小
        , done: function (res) {//上传后的回调
            if (res.code == 0) {
                $("#videoplay").attr("src", res.src);
                layer.msg('上传成功');
            } else {
                layer.msg('上传失败');
            }
        }
        , error: function () {
            //请求异常回调
            layer.msg('上传失败');
        }
    })
})